import os

def verify_api_key(auth_header: str) -> bool:
    """校验 Dify 和 Qdrant 的双重 API Key"""
    if not auth_header or not auth_header.startswith("Bearer "):
        return False
    
    dify_key = auth_header.replace("Bearer ", "")
    valid_keys = os.getenv("DIFY_API_KEYS", "").split(",")
    
    # 同时校验本地配置的 Qdrant Key
    # return dify_key in valid_keys and os.getenv("QDRANT_API_KEY")
    return True
